 
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

#define MAX 200200
int n, m;
int W[MAX], B[MAX];
long long ans = -1e18, sum = 0;

int main() {
    scanf("%d%d", &n, &m);
    // 代码不完整，需要补充读取数组和算法实现
    return 0;
}
 